import React, { Component } from 'react';
import Router, { HashRouter } from '@/router/renderRouter';
import { routes } from './router'
import { inject, observer, } from 'mobx-react'
import history from '@/utils/history'
import './app.scss';

@inject('store')
@observer
class App extends Component {
  componentDidMount() {
    let { setSettings, settings } = this.props.store
    setSettings('theme', settings.theme);
  }
  render() {
    return (
      <div id="App" className="animate__animated">
        <HashRouter history={history}>
          {
            new Router({
              routes,
              redirect: '/login'
            })
          }
        </HashRouter>
      </div>
    )
  }
}
export default App